package com.example.order.service.impl;
 
import com.example.order.entity.Order;
import com.example.order.mapper.OrderMapper;
import com.example.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OrderServiceImpl implements OrderService {
 
    @Autowired
    private OrderMapper orderMapper;


    @Transactional(rollbackFor = Exception.class)
    @Override
    public void addOrder() {
        Order order=new Order();
        order.setOrderName("订单名称");
        orderMapper.insert(order);
    }
}